package com.bidevalution.business.exception;

import com.bidevalution.business.vo.CheckJobVo;
import lombok.Data;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 数据校验
 * Created by whc on 2019/11/11.
 * @author whc
 */
@Data
public class CheckException extends BaseException {
    //抛出异常 自动插入，过度阶段状态。
    private boolean autoInsert = false;
    private List<String> resetStateExperts = new ArrayList<>();
    private String errorMsg;
    private String successMsg;

    /**
     * 通知全部专家map ,value 为 专家错误detail信息。
     */
    private Map<String, Object> notificationMap = new HashMap<>();

    public CheckException(String message) {
        super(message);
    }
    public CheckException(String message, List<String> resetUnFinishStateExperts) {
        super(message);
        this.resetStateExperts = resetUnFinishStateExperts;
    }

    /**
     *
     * @param title 异常类 massge
     * @param notificationMap Map<String, List<String>> 会接受到通知的专家清单，value 异常消息的 details
     * @param errorMsg  错误专家收到的提示
     * @param successMsg 正常专家收到的提示
     */
    public CheckException(String title,Map notificationMap, String errorMsg, String successMsg) {
        super(title);
        this.autoInsert = true;
        this.notificationMap = notificationMap;
        this.errorMsg = errorMsg;
        this.successMsg = successMsg;
    }
}